{% extends "bootstrap/base.html" %}
{% block title %}首页{% endblock %}
{% block styles %}
    {{ super() }}
    <style>
        #myfoot {
            border-top: 1px solid darkgray;
            font-size: 14px;
            text-align: center;
            color: cornflowerblue;
        }
    </style>
{% endblock %}

{% block navbar %}
    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <a class="navbar-brand" href="#">个人博客</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="{{ url_for('user.index') }}">首页 <span
                            class="sr-only">(current)</span></a></li>
                    <li><a href="#">关于我</a></li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                           aria-expanded="false">文章分类<span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            {% for article_type in article_types %}
                                <li><a href="{{ url_for('article.article_type_select') }}?tid={{ article_type.id }}">{{ article_type.type }}</a></li>
                                {% if not loop.last %}
                                    <li role="separator" class="divider"></li>
                                {% endif %}
                            {% endfor %}
                        </ul>
                    </li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                           aria-expanded="false">功能<span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">文章</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="#">写文章</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="{{ url_for('user.user_show') }}">用户中心</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="#">美女</a></li>
                        </ul>
                    </li>
                    <li><a href="#">相册</a></li>
                    <li><a href="#">留言板</a></li>
                </ul>
                <form class="navbar-form navbar-left">
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="Search">
                    </div>
                    <button type="submit" class="btn btn-default">搜索</button>
                </form>
                <ul class="nav navbar-nav navbar-right">
                    {% if user %}
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                               aria-haspopup="true" aria-expanded="false">
                                <img src="


                                        {% if user.icon %}{{ url_for('static',filename=user.icon) }}{% else %}{{ url_for('static',filename='image/touxiang.jpg') }}{% endif %}"
                                     alt="" class="img-circle" width="30" height="30">
                                你好！{{ user.username }}<span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li><a href="{{ url_for('user.user_show') }}">用户中心</a></li>
                                <li><a href="{{ url_for('user.user_update') }}?uid={{ user.id }}">修改信息</a></li>
                                <li><a href="{{ url_for('user.user_logout') }}">退出登录</a></li>
                            </ul>
                        </li>
                    {% else %}
                        <li><a href="{{ url_for('user.user_login') }}">登录</a></li>
                        <li><a href="{{ url_for('user.user_register') }}">注册</a></li>
                    {% endif %}
                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
{% endblock %}

{% block content %}
    {% block newcontent %}
        <h1>Hello, Bootstrap</h1>
    {% endblock %}
    {% block footers %}
        <p id="myfoot">©2021, Daft_V has come to.</p>
    {% endblock %}

{% endblock %}
{% block myjs %}{% endblock %}